#include <stdio.h>

typedef struct BNode{
    BNode * lchild;
    BNode * rchild;
    int data;
}BNode, *BTree;

void visit(BTree T){
    printf("%d\n",T->data);
}

//遍历二叉树
//先序遍历
void preorder(BTree T){
    if (T != NULL)
    {
        visit(T);
        preorder(T->lchild);
        preorder(T->rchild);
    }
    
    return ;
}


//中序遍历
void inorder(BTree T){
    if (T != NULL)
    {
        inorder(T->lchild);
        visit(T);
        inorder(T->rchild);
    }
    return ;
}

//后序遍历
void postorder(BTree T){
    if (T != NULL)
    {
        postorder(T->lchild);
        postorder(T->rchild);
        visit(T);
    }
    return ;
}
